import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Recommend from '../views/home/Recommend.vue'
import Phone from '../views/home/Phone.vue'
import Ai from '../views/home/Ai.vue'
import Tv from '../views/home/Tv.vue'
import Laptop from '../views/home/Laptop.vue'
import Appliances from '../views/home/Appliances.vue'
import Around from '../views/home/Around.vue'
import Sort from '../views/Sort.vue'
import Star from '../views/Star.vue'
import Cart from '../views/Cart.vue'
import Myself from '../views/Myself.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    redirect:'/home/recommend'
  },
  {
    path:'/home',
    component:Home,
    redirect:'/home/recommend',
    children:[
      {
        path:'recommend',
        component:Recommend,
        meta:{
          order:1,
          headShow:true
        }
      },
      {
        path:'phone',
        component:Phone,
        meta:{
          order:2,
          headShow:true
        }
      },
      {
        path:'ai',
        component:Ai,
        meta:{
          order:3,
          headShow:true
        }
      },
      {
        path:'tv',
        component:Tv,
        meta:{
          order:4,
          headShow:true
        }
      },
      {
        path:'laptop',
        component:Laptop,
        meta:{
          order:5,
          headShow:true
        }
      },
      {
        path:'appliances',
        component:Appliances,
        meta:{
          order:6,
          headShow:true
        }
      },
      {
        path:'around',
        component:Around,
        meta:{
          order:7,
          headShow:true
        }
      }
    ]
  },
  {
    path:'/sort',
    component:Sort,
    meta:{
      headShow:false
    }
  },
  {
    path:'/star',
    component:Star,
    meta:{
      headShow:false
    }
  },{
    path:'/cart',
    component:Cart,
    meta:{
      headShow:false
    }
  },
  {
    path:'/myself',
    component:Myself,
    meta:{
      headShow:false
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
